/*
*    Phantom Test Driver v2.0 GUI Automation Software
*    Copyright (C) 2009  John C. Van Arsdall (john@phantomtest.com)
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License along
*    with this program; if not, write to the Free Software Foundation, Inc.,
*    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
/*
 * PTDAboutBox.java
 *
 * Created on September 8, 2008, 2:11 PM
 */

package ptd;

import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.ImageIcon;

/**
 *
 * @author  John
 */
public class PTDAboutBox extends javax.swing.JFrame {

    /** Creates new form PTDAboutBox */
    public PTDAboutBox() {
        initComponents();
        TitleLabel.setText("Phantom Test Driver");
        VersionLabel.setText(" version 2.1 ");
        WebLabel.setText("http://www.phantomtest.com");
        OKButton.setText("OK");
        
        TitleLabel.setBorder(null);
        VersionLabel.setBorder(null);
        WebLabel.setBorder(null);
        
        ImageIcon a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_PTD_ICON);
        setIconImage(a.getImage());
        this.setSize(290, 155);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_PTD_LABEL);
        IconLabel.setIcon(a);
        IconLabel.setText("");

        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
        this.setLocation((dim.width-290)/2, (dim.height-190)/2);        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        TitleLabel = new javax.swing.JLabel();
        OKButton = new javax.swing.JButton();
        WebLabel = new javax.swing.JLabel();
        VersionLabel = new javax.swing.JLabel();
        IconLabel = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("About PTD");
        getContentPane().setLayout(null);

        TitleLabel.setFont(new java.awt.Font("Tahoma", 0, 18));
        TitleLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        getContentPane().add(TitleLabel);
        TitleLabel.setBounds(80, 10, 200, 30);

        OKButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OKButtonActionPerformed(evt);
            }
        });
        getContentPane().add(OKButton);
        OKButton.setBounds(120, 90, 70, 20);

        WebLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        getContentPane().add(WebLabel);
        WebLabel.setBounds(80, 60, 180, 20);

        VersionLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        getContentPane().add(VersionLabel);
        VersionLabel.setBounds(130, 40, 100, 20);

        IconLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        getContentPane().add(IconLabel);
        IconLabel.setBounds(10, 30, 60, 60);

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void OKButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OKButtonActionPerformed
    dispose();
}//GEN-LAST:event_OKButtonActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PTDAboutBox().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel IconLabel;
    private javax.swing.JButton OKButton;
    private javax.swing.JLabel TitleLabel;
    private javax.swing.JLabel VersionLabel;
    private javax.swing.JLabel WebLabel;
    // End of variables declaration//GEN-END:variables

}
